package com.tianruan.dc.modules.sys.user.api;

import com.tianruan.dc.common.constant.GlobalExceptionEnum;
import com.tianruan.dc.common.exception.GlobalException;
import com.tianruan.dc.common.utils.JedisUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/api/sys/test")
public class TestController {

    @GetMapping
    public void test() {

        Map<String, String> map = new HashMap<>();
        map.put("test", "dong");
        map.put("test1", "dong1");
        JedisUtils.setMap("testMap", map);

        JedisUtils.mapRemove("testMap", "test1");

        throw new GlobalException(GlobalExceptionEnum.WARNING);
    }
}
